package qunchat;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

public class TransSever{

	public static void main(String[] args) throws IOException {
		  int port=8101;
		ServerSocket ss=new ServerSocket(port);	
		List<Socket> ls=new ArrayList<>();			
		System.out.println("服务器开启成功，等待用户进入......");
		Socket s;
		while(true){
	    s=ss.accept();
	    System.out.println(s.getPort()+":"+"加入聊天...");
		 ls.add(s);		
		new ServerThread(s, ls).start();
		
		}
	}

}
